# 1.导包
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
# 2.打开浏览器（创建浏览器驱动对象）
service = Service(r'F:\python 3.12\chromedriver.exe')
driver = webdriver.Chrome(service=service)
# 3.输入网址
driver.get("http://121.43.169.97:8848/pageA.html")
# 放大浏览器
driver.maximize_window()
time.sleep(1)
# 模拟用户操作
# 获取用户名：通过标签ID、标签属性、标签class、标签名
driver.find_element(By.CSS_SELECTOR, "#userA").send_keys("admin")  # id属性值
driver.find_element(By.CSS_SELECTOR, "[name='passwordA']").send_keys("123456")  # 标签属性
driver.find_element(By.CSS_SELECTOR, ".telA").send_keys("13800000001")  # class属性值
# 输入邮箱信息：多个class值，通过点号连接
driver.find_element(by=By.CSS_SELECTOR,
value=".emailA.dzyxA").send_keys("123456@qq.com")
driver.find_element(By.CSS_SELECTOR, "button").click()  # 标签名
# 等待
time.sleep(90)
# 退出浏览器
driver.quit()